<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
	StringBuffer strURL = request.getRequestURL();
	String URL = strURL.toString();
	String contPath = request.getContextPath();
	int nIndex = URL.indexOf(contPath);
	URL = "http://tugo.cn/weixin_aef/";
	%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
	content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="<%=URL%>newedition/css/aui.css" />
<link rel="stylesheet" href="<%=URL%>newedition/css/iconfont.css" />
<link rel="stylesheet" href="<%=URL%>newedition/css/aui-slide.css" />
<link rel="stylesheet"
	href="<%=URL%>newedition/css/user_infoList.css" />
<link rel="stylesheet"
	href="<%=URL%>newedition/css/aui-pull-refresh.css" />
<script type="text/javascript" src="<%=URL%>newedition/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="<%=URL%>js/cookies.js?version=1.1"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-pull-refresh.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/doRefresh.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-pull-refresh.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/doRefresh.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-dialog.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-toast.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/auipopupstyle.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/aui-slide.js"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/base.js?version=3.6"></script>
<script type="text/javascript" src="<%=URL%>newedition/js/recycle/user_infoNotes.js"></script>
<script type="text/javascript" src="<%=URL%>js/doT.min.js"></script>
	<title>用户个人信息</title>
	</head>

	<body>
	<input type=hidden name=contextPath
		value=<%= request.getContextPath()%> id="requestpath">
		<div class="body-box" style="display: none;">
			<div class="haeder-box">
				<div class=" haeder-left">
					<i>
						<span class="haeder-img" id="heard"></span>
					</i>
				</div>
				<div class=" haeder-right">
					<div class="haeder-name" id="realname"></div>
					<!-- <div class="haeder-LV">等级:V3</div>
					<div class="haeder-integral">积分：10000</div> -->
				</div>
			</div>
			<div class="aui-content aui-margin-b-15 info-list">
				<ul class="aui-list aui-list-in">
					<li class="aui-list-item" onclick="$(location).attr('href', 'user_infoNotes.jsp');">
						<div class="aui-list-item-label-icon">
							<i class="icon iconfont icon-shuidi"></i>
						</div>
						<div class="aui-list-item-inner">
							售油记录
						</div>
					</li>
					<li class="aui-list-item" onclick="$(location).attr('href', 'user_infoData.jsp');">
						<div class="aui-list-item-label-icon">
							<i class="icon iconfont icon-ziliao"></i>
						</div>
						<div class="aui-list-item-inner">
							个人资料
						</div>
					</li>
					<li class="aui-list-item" onclick="$(location).attr('href', '<%=URL%>weixinuser/unread-notice.jsp');">
						<div class="aui-list-item-label-icon">
							<i class="icon iconfont icon-youjian"></i>
						</div>
						<div class="aui-list-item-inner">
							通知消息
						</div>
					</li>
					<li class="aui-list-item" onclick="$(location).attr('href', 'user_infoHlep.jsp');">
						<div class="aui-list-item-label-icon">
							<i class="icon iconfont icon-bangzhudisc"></i>
						</div>
						<div class="aui-list-item-inner">
							使用指南
						</div>
					</li>
				</ul>
			</div>
		</div>
		<script>
		$(function() {
			var json = {"openid": ""+getCookie("openid")+""}
			$.ajax({
				cache: false,
				type: "post",
				dataType:"json",/*加上datatype*/
				data: JSON.stringify(json),
				contentType: 'application/json;charset=UTF-8',
				url: ''+httpipstr+'alfa-mobile-ws/rest/OpenId/GetSingleOpenId',
				success: function(data) {
					if(data.message=="1"){
						$("#heard").css('background','url('+data.data.headimgurl+') no-repeat'); 
						$("#heard").css('background-size','110% 110%'); 
						if(data.data.mobiletoken==""||data.data.mobiletoken==null){
							clearsalesmanCookieWithIdAll()
							clearuserCookieWithIdAll()
							location.href = "user_login.jsp" 
						}else{
							if(data.data.roleId=="10"){
								clearsalesmanCookieWithIdAll()
								setcookie("roleId", data.data.roleId, 30, "/");
								setcookie("mobiletokenuser", data.data.mobiletoken, 30, "/");
								setcookie("username", data.data.mobile, 300, "/");
								setcookie("useriphone", data.data.mobile, 300, "/");
								setcookie("realname", data.data.realname, 300, "/");
								setcookie("orgname", data.data.orgname, 300, "/");
								setcookie("userid", data.data.sysuserid, 300, "/");
								setcookie("address", data.data.address, 300, "/");
								$(".body-box").show();
							}else if(data.data.roleId=="9"){
								clearuserCookieWithIdAll()
								setcookie("salesmanid", data.data.sysuserid, 300, "/");
								setcookie("mobiletokensalesman", data.data.mobiletoken, 300, "/");
								setcookie("username", data.data.username, 300, "/");
								setcookie("salesmaniphone", data.data.mobile, 300, "/");
								setcookie("roleId", data.data.roleId, 30, "/")
								location.href = "user_login.jsp" 
							}
						}
						
					}else{
						var requestpath=$("#requestpath").val();
						$.ajax({
							cache: false,
							type: "post",
							dataType:"json",/*加上datatype*/
							data: JSON.stringify(json),
							contentType: 'application/json;charset=UTF-8',
							url: 'http://tugo.cn/weixin_aef/recycle/addopenidinfo',
							success: function(data) {
								if(data.code=="0"){
									location.href = "user_login.jsp" 
								}
							}
						})
					}
					
				}
			});
	})
	</script>
	</body>
	

</html>